{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "      index 等级  一技能 Lv  二技能  Lv1   孔  index      temp\n",
      "0         0  7   13  1   92  1.0  21      0 -0.382017\n",
      "1         1  6   76  2   41  1.0  11      1 -0.223731\n",
      "2         2  5   79  1   18  2.0  11      2  1.971058\n",
      "3         3  6   62  1   41  1.0  11      3 -0.382017\n",
      "4         4  7  106  2   23  1.0   1      4 -0.223731\n",
      "...     ... ..  ... ..  ...  ...  ..    ...       ...\n",
      "1495   1495  5   46  1  112    0   0   1495 -2.735093\n",
      "1496   1496  7   85  1   52  1.0  31   1496 -0.382017\n",
      "1497   1497  4  104  2   89  1.0   1   1497 -0.223731\n",
      "1498   1498  4   16  3   65  1.0   0   1498 -0.065445\n",
      "1499      0  7    3  2    2    2   2   1499  2.129344\n",
      "\n",
      "[1500 rows x 9 columns]\n",
      "     等级  孔      temp\n",
      "1499  7  2  2.129344\n",
      "[2]\n",
      "      index 等级  一技能 Lv  二技能  Lv1    孔  index      temp\n",
      "0         0  7   13  1   92  1.0   21      0 -0.382017\n",
      "1         1  6   76  2   41  1.0   11      1 -0.223731\n",
      "2         2  5   79  1   18  2.0   11      2  1.971058\n",
      "3         3  6   62  1   41  1.0   11      3 -0.382017\n",
      "4         4  7  106  2   23  1.0    1      4 -0.223731\n",
      "...     ... ..  ... ..  ...  ...  ...    ...       ...\n",
      "1495   1495  5   46  1  112    0    0   1495 -2.735093\n",
      "1496   1496  7   85  1   52  1.0   31   1496 -0.382017\n",
      "1497   1497  4  104  2   89  1.0    1   1497 -0.223731\n",
      "1498   1498  4   16  3   65  1.0    0   1498 -0.065445\n",
      "1499      0  7    3  2    2    2  111   1499  2.129344\n",
      "\n",
      "[1500 rows x 9 columns]\n",
      "     等级    孔      temp\n",
      "1499  7  111  2.129344\n",
      "[3]\n",
      "      index 等级  一技能 Lv  二技能  Lv1    孔  index      temp\n",
      "0         0  7   13  1   92  1.0   21      0 -0.382017\n",
      "1         1  6   76  2   41  1.0   11      1 -0.223731\n",
      "2         2  5   79  1   18  2.0   11      2  1.971058\n",
      "3         3  6   62  1   41  1.0   11      3 -0.382017\n",
      "4         4  7  106  2   23  1.0    1      4 -0.223731\n",
      "...     ... ..  ... ..  ...  ...  ...    ...       ...\n",
      "1495   1495  5   46  1  112    0    0   1495 -2.735093\n",
      "1496   1496  7   85  1   52  1.0   31   1496 -0.382017\n",
      "1497   1497  4  104  2   89  1.0    1   1497 -0.223731\n",
      "1498   1498  4   16  3   65  1.0    0   1498 -0.065445\n",
      "1499      0  7    3  2    2    2  211   1499  2.129344\n",
      "\n",
      "[1500 rows x 9 columns]\n",
      "     等级    孔      temp\n",
      "1499  7  211  2.129344\n",
      "[2]\n",
      "      index 等级  一技能 Lv  二技能  Lv1    孔  index      temp\n",
      "0         0  7   13  1   92  1.0   21      0 -0.382017\n",
      "1         1  6   76  2   41  1.0   11      1 -0.223731\n",
      "2         2  5   79  1   18  2.0   11      2  1.971058\n",
      "3         3  6   62  1   41  1.0   11      3 -0.382017\n",
      "4         4  7  106  2   23  1.0    1      4 -0.223731\n",
      "...     ... ..  ... ..  ...  ...  ...    ...       ...\n",
      "1495   1495  5   46  1  112    0    0   1495 -2.735093\n",
      "1496   1496  7   85  1   52  1.0   31   1496 -0.382017\n",
      "1497   1497  4  104  2   89  1.0    1   1497 -0.223731\n",
      "1498   1498  4   16  3   65  1.0    0   1498 -0.065445\n",
      "1499      0  7    3  2    2    2  221   1499  2.129344\n",
      "\n",
      "[1500 rows x 9 columns]\n",
      "     等级    孔      temp\n",
      "1499  7  221  2.129344\n",
      "[2]\n",
      "      index 等级  一技能 Lv  二技能  Lv1    孔  index      temp\n",
      "0         0  7   13  1   92  1.0   21      0 -0.382017\n",
      "1         1  6   76  2   41  1.0   11      1 -0.223731\n",
      "2         2  5   79  1   18  2.0   11      2  1.971058\n",
      "3         3  6   62  1   41  1.0   11      3 -0.382017\n",
      "4         4  7  106  2   23  1.0    1      4 -0.223731\n",
      "...     ... ..  ... ..  ...  ...  ...    ...       ...\n",
      "1495   1495  5   46  1  112    0    0   1495 -2.735093\n",
      "1496   1496  7   85  1   52  1.0   31   1496 -0.382017\n",
      "1497   1497  4  104  2   89  1.0    1   1497 -0.223731\n",
      "1498   1498  4   16  3   65  1.0    0   1498 -0.065445\n",
      "1499      0  7    3  2    2    2  111   1499  2.129344\n",
      "\n",
      "[1500 rows x 9 columns]\n",
      "     等级    孔      temp\n",
      "1499  7  111  2.129344\n",
      "[3]\n",
      "      index 等级  一技能 Lv  二技能  Lv1    孔  index      temp\n",
      "0         0  7   13  1   92  1.0   21      0 -0.382017\n",
      "1         1  6   76  2   41  1.0   11      1 -0.223731\n",
      "2         2  5   79  1   18  2.0   11      2  1.971058\n",
      "3         3  6   62  1   41  1.0   11      3 -0.382017\n",
      "4         4  7  106  2   23  1.0    1      4 -0.223731\n",
      "...     ... ..  ... ..  ...  ...  ...    ...       ...\n",
      "1495   1495  5   46  1  112    0    0   1495 -2.735093\n",
      "1496   1496  7   85  1   52  1.0   31   1496 -0.382017\n",
      "1497   1497  4  104  2   89  1.0    1   1497 -0.223731\n",
      "1498   1498  4   16  3   65  1.0    0   1498 -0.065445\n",
      "1499      0  7    3  2    2    2  211   1499  2.129344\n",
      "\n",
      "[1500 rows x 9 columns]\n",
      "     等级    孔      temp\n",
      "1499  7  211  2.129344\n",
      "[2]\n",
      "      index 等级  一技能 Lv  二技能  Lv1    孔  index      temp\n",
      "0         0  7   13  1   92  1.0   21      0 -0.382017\n",
      "1         1  6   76  2   41  1.0   11      1 -0.223731\n",
      "2         2  5   79  1   18  2.0   11      2  1.971058\n",
      "3         3  6   62  1   41  1.0   11      3 -0.382017\n",
      "4         4  7  106  2   23  1.0    1      4 -0.223731\n",
      "...     ... ..  ... ..  ...  ...  ...    ...       ...\n",
      "1495   1495  5   46  1  112    0    0   1495 -2.735093\n",
      "1496   1496  7   85  1   52  1.0   31   1496 -0.382017\n",
      "1497   1497  4  104  2   89  1.0    1   1497 -0.223731\n",
      "1498   1498  4   16  3   65  1.0    0   1498 -0.065445\n",
      "1499      0  7    3  2    2    2  111   1499  2.129344\n",
      "\n",
      "[1500 rows x 9 columns]\n",
      "     等级    孔      temp\n",
      "1499  7  111  2.129344\n",
      "[3]\n",
      "      index 等级  一技能 Lv  二技能  Lv1    孔  index      temp\n",
      "0         0  7   13  1   92  1.0   21      0 -0.382017\n",
      "1         1  6   76  2   41  1.0   11      1 -0.223731\n",
      "2         2  5   79  1   18  2.0   11      2  1.971058\n",
      "3         3  6   62  1   41  1.0   11      3 -0.382017\n",
      "4         4  7  106  2   23  1.0    1      4 -0.223731\n",
      "...     ... ..  ... ..  ...  ...  ...    ...       ...\n",
      "1495   1495  5   46  1  112    0    0   1495 -2.735093\n",
      "1496   1496  7   85  1   52  1.0   31   1496 -0.382017\n",
      "1497   1497  4  104  2   89  1.0    1   1497 -0.223731\n",
      "1498   1498  4   16  3   65  1.0    0   1498 -0.065445\n",
      "1499      0  7    3  2    2    2  211   1499  2.129344\n",
      "\n",
      "[1500 rows x 9 columns]\n",
      "     等级    孔      temp\n",
      "1499  7  211  2.129344\n",
      "[2]\n",
      "      index 等级  一技能 Lv  二技能  Lv1   孔  index      temp\n",
      "0         0  7   13  1   92  1.0  21      0 -0.382017\n",
      "1         1  6   76  2   41  1.0  11      1 -0.223731\n",
      "2         2  5   79  1   18  2.0  11      2  1.971058\n",
      "3         3  6   62  1   41  1.0  11      3 -0.382017\n",
      "4         4  7  106  2   23  1.0   1      4 -0.223731\n",
      "...     ... ..  ... ..  ...  ...  ..    ...       ...\n",
      "1495   1495  5   46  1  112    0   0   1495 -2.735093\n",
      "1496   1496  7   85  1   52  1.0  31   1496 -0.382017\n",
      "1497   1497  4  104  2   89  1.0   1   1497 -0.223731\n",
      "1498   1498  4   16  3   65  1.0   0   1498 -0.065445\n",
      "1499      0  7    3  2    2    2  32   1499  2.129344\n",
      "\n",
      "[1500 rows x 9 columns]\n",
      "     等级   孔      temp\n",
      "1499  7  32  2.129344\n",
      "[2]\n",
      "      index 等级  一技能 Lv  二技能  Lv1    孔  index      temp\n",
      "0         0  7   13  1   92  1.0   21      0 -0.382017\n",
      "1         1  6   76  2   41  1.0   11      1 -0.223731\n",
      "2         2  5   79  1   18  2.0   11      2  1.971058\n",
      "3         3  6   62  1   41  1.0   11      3 -0.382017\n",
      "4         4  7  106  2   23  1.0    1      4 -0.223731\n",
      "...     ... ..  ... ..  ...  ...  ...    ...       ...\n",
      "1495   1495  5   46  1  112    0    0   1495 -2.735093\n",
      "1496   1496  7   85  1   52  1.0   31   1496 -0.382017\n",
      "1497   1497  4  104  2   89  1.0    1   1497 -0.223731\n",
      "1498   1498  4   16  3   65  1.0    0   1498 -0.065445\n",
      "1499      0  7    3  2    2    2  111   1499  2.129344\n",
      "\n",
      "[1500 rows x 9 columns]\n",
      "     等级    孔      temp\n",
      "1499  7  111  2.129344\n",
      "[3]\n",
      "      index 等级  一技能 Lv  二技能  Lv1    孔  index      temp\n",
      "0         0  7   13  1   92  1.0   21      0 -0.382009\n",
      "1         1  6   76  2   41  1.0   11      1 -0.223743\n",
      "2         2  5   79  1   18  2.0   11      2  1.971068\n",
      "3         3  6   62  1   41  1.0   11      3 -0.382009\n",
      "4         4  7  106  2   23  1.0    1      4 -0.223743\n",
      "...     ... ..  ... ..  ...  ...  ...    ...       ...\n",
      "1495   1495  5   46  1  112    0    0   1495 -2.735087\n",
      "1496   1496  7   85  1   52  1.0   31   1496 -0.382009\n",
      "1497   1497  4  104  2   89  1.0    1   1497 -0.223743\n",
      "1498   1498  4   16  3   65  1.0    0   1498 -0.065476\n",
      "1499      0  7    9  2    2    2  111   1499  2.129335\n",
      "\n",
      "[1500 rows x 9 columns]\n",
      "     等级    孔      temp\n",
      "1499  7  111  2.129335\n",
      "[3]\n",
      "      index 等级  一技能 Lv  二技能  Lv1   孔  index      temp\n",
      "0         0  7   13  1   92  1.0  21      0 -0.382009\n",
      "1         1  6   76  2   41  1.0  11      1 -0.223743\n",
      "2         2  5   79  1   18  2.0  11      2  1.971068\n",
      "3         3  6   62  1   41  1.0  11      3 -0.382009\n",
      "4         4  7  106  2   23  1.0   1      4 -0.223743\n",
      "...     ... ..  ... ..  ...  ...  ..    ...       ...\n",
      "1495   1495  5   46  1  112    0   0   1495 -2.735087\n",
      "1496   1496  7   85  1   52  1.0  31   1496 -0.382009\n",
      "1497   1497  4  104  2   89  1.0   1   1497 -0.223743\n",
      "1498   1498  4   16  3   65  1.0   0   1498 -0.065476\n",
      "1499      0  7    9  2    2    2  11   1499  2.129335\n",
      "\n",
      "[1500 rows x 9 columns]\n",
      "     等级   孔      temp\n",
      "1499  7  11  2.129335\n",
      "[1]\n",
      "      index 等级  一技能 Lv  二技能  Lv1    孔  index      temp\n",
      "0         0  7   13  1   92  1.0   21      0 -0.382009\n",
      "1         1  6   76  2   41  1.0   11      1 -0.223743\n",
      "2         2  5   79  1   18  2.0   11      2  1.971068\n",
      "3         3  6   62  1   41  1.0   11      3 -0.382009\n",
      "4         4  7  106  2   23  1.0    1      4 -0.223743\n",
      "...     ... ..  ... ..  ...  ...  ...    ...       ...\n",
      "1495   1495  5   46  1  112    0    0   1495 -2.735087\n",
      "1496   1496  7   85  1   52  1.0   31   1496 -0.382009\n",
      "1497   1497  4  104  2   89  1.0    1   1497 -0.223743\n",
      "1498   1498  4   16  3   65  1.0    0   1498 -0.065476\n",
      "1499      0  7    9  2    2    2  211   1499  2.129335\n",
      "\n",
      "[1500 rows x 9 columns]\n",
      "     等级    孔      temp\n",
      "1499  7  211  2.129335\n",
      "[2]\n",
      "      index 等级  一技能 Lv  二技能  Lv1    孔  index      temp\n",
      "0         0  7   13  1   92  1.0   21      0 -0.382009\n",
      "1         1  6   76  2   41  1.0   11      1 -0.223743\n",
      "2         2  5   79  1   18  2.0   11      2  1.971068\n",
      "3         3  6   62  1   41  1.0   11      3 -0.382009\n",
      "4         4  7  106  2   23  1.0    1      4 -0.223743\n",
      "...     ... ..  ... ..  ...  ...  ...    ...       ...\n",
      "1495   1495  5   46  1  112    0    0   1495 -2.735087\n",
      "1496   1496  7   85  1   52  1.0   31   1496 -0.382009\n",
      "1497   1497  4  104  2   89  1.0    1   1497 -0.223743\n",
      "1498   1498  4   16  3   65  1.0    0   1498 -0.065476\n",
      "1499      0  7    9  2    2    2  311   1499  2.129335\n",
      "\n",
      "[1500 rows x 9 columns]\n",
      "     等级    孔      temp\n",
      "1499  7  311  2.129335\n",
      "[3]\n",
      "      index 等级  一技能 Lv  二技能  Lv1    孔  index      temp\n",
      "0         0  7   13  1   92  1.0   21      0 -0.382009\n",
      "1         1  6   76  2   41  1.0   11      1 -0.223743\n",
      "2         2  5   79  1   18  2.0   11      2  1.971068\n",
      "3         3  6   62  1   41  1.0   11      3 -0.382009\n",
      "4         4  7  106  2   23  1.0    1      4 -0.223743\n",
      "...     ... ..  ... ..  ...  ...  ...    ...       ...\n",
      "1495   1495  5   46  1  112    0    0   1495 -2.735087\n",
      "1496   1496  7   85  1   52  1.0   31   1496 -0.382009\n",
      "1497   1497  4  104  2   89  1.0    1   1497 -0.223743\n",
      "1498   1498  4   16  3   65  1.0    0   1498 -0.065476\n",
      "1499      0  7    9  2    2    2  221   1499  2.129335\n",
      "\n",
      "[1500 rows x 9 columns]\n",
      "     等级    孔      temp\n",
      "1499  7  221  2.129335\n",
      "[2]\n",
      "      index 等级  一技能 Lv  二技能  Lv1   孔  index      temp\n",
      "0         0  7   13  1   92  1.0  21      0 -0.382009\n",
      "1         1  6   76  2   41  1.0  11      1 -0.223743\n",
      "2         2  5   79  1   18  2.0  11      2  1.971068\n",
      "3         3  6   62  1   41  1.0  11      3 -0.382009\n",
      "4         4  7  106  2   23  1.0   1      4 -0.223743\n",
      "...     ... ..  ... ..  ...  ...  ..    ...       ...\n",
      "1495   1495  5   46  1  112    0   0   1495 -2.735087\n",
      "1496   1496  7   85  1   52  1.0  31   1496 -0.382009\n",
      "1497   1497  4  104  2   89  1.0   1   1497 -0.223743\n",
      "1498   1498  4   16  3   65  1.0   0   1498 -0.065476\n",
      "1499      0  7    9  2    2    2  31   1499  2.129335\n",
      "\n",
      "[1500 rows x 9 columns]\n",
      "     等级   孔      temp\n",
      "1499  7  31  2.129335\n",
      "[2]\n"
     ]
    }
   ],
   "source": [
    "import tkinter as tk\n",
    "from tkinter import StringVar, ttk, messagebox\n",
    "import openpyxl\n",
    "import joblib\n",
    "import pandas as pd\n",
    "from sklearn.discriminant_analysis import LinearDiscriminantAnalysis as LDA\n",
    "from sklearn.decomposition import PCA\n",
    "import numpy as np\n",
    "\n",
    "\n",
    "\n",
    "class stone:\n",
    "    def __init__(self, r, name1, lv1, name2, lv2, hole):\n",
    "        self.rarity = r\n",
    "        self.name1 = name1\n",
    "        if self.name1 == \"无\":\n",
    "            self.lv1 = '0'\n",
    "        else:\n",
    "            self.lv1 = lv1\n",
    "        self.name2 = name2\n",
    "        if self.name2 == \"无\":\n",
    "            self.lv2 = '0'\n",
    "        else:\n",
    "            self.lv2 = lv2\n",
    "        self.hole = hole\n",
    "\n",
    "    def judge(self):\n",
    "        estimator = joblib.load('cls.model')\n",
    "        skill = pd.read_excel(\"skill.xlsx\")\n",
    "        stone_old= pd.read_excel(\"半监督.xlsx\")\n",
    "        stone_old=stone_old.iloc[:,:6]\n",
    "        # print(stone_old.head())\n",
    "\n",
    "        stone = pd.DataFrame([[self.rarity, self.name1, self.lv1, self.name2, self.lv2, self.hole]], columns=['等级', '一技能', 'Lv', '二技能', 'Lv1', '孔'])\n",
    "        skillArray = skill[\"LookUpName\"].values\n",
    "        \n",
    "        stone = pd.concat((stone_old, stone), axis=0)\n",
    "        \n",
    "        # 处理缺失值\n",
    "        stone.fillna({\"二技能\":\"无\",\"Lv1\":0},inplace=True)\n",
    "\n",
    "        #处理技能,将技能名称用数字替换\n",
    "        skillArray = skill[\"LookUpName\"].values\n",
    "        stone['一技能'].replace(skillArray,list(range(1,113)),inplace=True)\n",
    "        stone['二技能'].replace(skillArray,list(range(1,113)),inplace=True)\n",
    "\n",
    "        lda = LDA(n_components=1)\n",
    "        pca = PCA(n_components=1)\n",
    "        skill1=stone[['一技能','Lv']]\n",
    "\n",
    "        re_1=lda.fit_transform(skill1,stone['一技能'])\n",
    "        skill2=stone[['二技能','Lv1']]\n",
    "        re_2=lda.fit_transform(skill2,stone['二技能'])\n",
    "        skill = np.concatenate((re_1, re_2), axis=1)\n",
    "        \n",
    "        re_skill = pca.fit_transform(totalskill)\n",
    "        stone=stone.reset_index()\n",
    "        temp= pd.DataFrame(re_skill, columns=['temp'])\n",
    "        temp=temp.reset_index()\n",
    "        df = pd.concat((stone,temp), axis=1)\n",
    "        print(df)\n",
    "        df.drop(['一技能','Lv','二技能','Lv1'],axis = 1,inplace=True)\n",
    "        data=df.iloc[[-1]]\n",
    "        del data['index']\n",
    "        print(data)\n",
    "        out = estimator.predict(data)\n",
    "        print(out)\n",
    "        tk.messagebox.showinfo('结果', estimator.predict(data))\n",
    "\n",
    "\n",
    "class MH_GUI:\n",
    "    def __init__(self):\n",
    "        self.top = tk.Tk()\n",
    "        self.top.geometry(\"500x300\")\n",
    "        self.top.resizable(0, 0)\n",
    "        self.top.title(\"Monster Hunter Stone\")\n",
    "        self.name_list = []\n",
    "        self.hole_list = []\n",
    "        self.rarit_list = []\n",
    "        self.read_name_list('./skill.xlsx', './stone.xlsx')\n",
    "        self.r_list = ['0', '1', '2', '3']\n",
    "        self.init_combobox()\n",
    "        self.init_lables()\n",
    "        self.init_button()\n",
    "        self.top.mainloop()\n",
    "\n",
    "    def init_button(self):\n",
    "        self.button = tk.Button(self.top, text=\"评判\", command=lambda: self.action()).place(x=240, y=250)\n",
    "\n",
    "    def action(self):\n",
    "        TheStone = stone(self.value6.get(), self.value1.get(), self.value2.get(), self.value3.get(), self.value4.get(), self.value5.get())\n",
    "        TheStone.judge()\n",
    "\n",
    "    def init_lables(self):\n",
    "        self.label1 = tk.Label(self.top, text=\"技能1:\").place(x=150, y=10)\n",
    "        self.label2 = tk.Label(self.top, text=\"Lv:\").place(x=150, y=50)\n",
    "        self.label3 = tk.Label(self.top, text=\"技能2:\").place(x=150, y=90)\n",
    "        self.label4 = tk.Label(self.top, text=\"Lv:\").place(x=150, y=130)\n",
    "        self.label5 = tk.Label(self.top, text=\"孔位\").place(x=150, y=170)\n",
    "        self.label5 = tk.Label(self.top, text=\"稀有度\").place(x=150, y=210)\n",
    "\n",
    "    def init_combobox(self):\n",
    "        self.value1 = StringVar()\n",
    "        self.value1.set(\"请选择技能1\")\n",
    "        self.value2 = StringVar()\n",
    "        self.value2.set(\"选择其等级\")\n",
    "        self.value3 = StringVar()\n",
    "        self.value3.set(\"请选择技能2\")\n",
    "        self.value4 = StringVar()\n",
    "        self.value4.set(\"选择其等级\")\n",
    "        self.value5 = StringVar()\n",
    "        self.value5.set(\"请选择其孔位\")\n",
    "        self.value6 = StringVar()\n",
    "        self.value6.set(\"请选择其稀有度\")\n",
    "        self.combobox1 = ttk.Combobox(self.top, textvariable=self.value1, height=10, width=20, values=self.name_list).place(x=200, y=10)\n",
    "        self.combobox2 = ttk.Combobox(self.top, textvariable=self.value2, height=len(self.r_list), width=20, values=self.r_list).place(x=200, y=50)\n",
    "        self.combobox3 = ttk.Combobox(self.top, textvariable=self.value3, height=10, width=20, values=self.name_list).place(x=200, y=90)\n",
    "        self.combobox4 = ttk.Combobox(self.top, textvariable=self.value4, height=len(self.r_list), width=20, values=self.r_list).place(x=200, y=130)\n",
    "        self.combobox5 = ttk.Combobox(self.top, textvariable=self.value5, height=10, width=20, values=self.hole_list).place(x=200, y=170)\n",
    "        self.combobox6 = ttk.Combobox(self.top, textvariable=self.value6, height=10, width=20, values=self.rarit_list).place(x=200, y=210)\n",
    "\n",
    "    def choose(self):\n",
    "        print(\"choose\")\n",
    "        data1 = self.value1.get()\n",
    "        result = 0\n",
    "        readbook = openpyxl.load_workbook('./skill.xlsx')\n",
    "        sheet = readbook['skill']    # 名字的方式\n",
    "        rows = sheet.max_row  # 行\n",
    "        for i in range(2, rows+1):\n",
    "            data = sheet.cell(i, 1).value\n",
    "            if data == data1:\n",
    "                result = int(sheet.cell(i, 3).value)\n",
    "                self.combobox2[\"value\"] = range(0, result)\n",
    "                break\n",
    "\n",
    "    def read_name_list(self, data_res, data_res1):\n",
    "        readbook = openpyxl.load_workbook(data_res)\n",
    "        sheet = readbook['skill']    # 名字的方式\n",
    "        rows = sheet.max_row  # 行\n",
    "        for i in range(2, rows+1):\n",
    "            data = sheet.cell(i, 1).value\n",
    "            self.name_list.append(data)\n",
    "        readbook = openpyxl.load_workbook(data_res1)\n",
    "        sheet = readbook['マカ錬金 幽玄 -ZH']    # 名字的方式\n",
    "        rows = sheet.max_row  # 行\n",
    "        for i in range(2, rows+1):\n",
    "            data = sheet.cell(i, 6).value\n",
    "            self.hole_list.append(data)\n",
    "        self.hole_list = list(set(self.hole_list))\n",
    "        readbook = openpyxl.load_workbook(data_res1)\n",
    "        sheet = readbook['マカ錬金 幽玄 -ZH']    # 名字的方式\n",
    "        rows = sheet.max_row  # 行\n",
    "        for i in range(2, rows+1):\n",
    "            data = sheet.cell(i, 1).value\n",
    "            self.rarit_list.append(data)\n",
    "        self.rarit_list = list(set(self.rarit_list))\n",
    "\n",
    "\n",
    "mh = MH_GUI()"
   ]
  }
 ],
 "metadata": {
  "interpreter": {
   "hash": "68ae21738e8993718d8ddaa6caf624313db28adb7fd0cad6249c8d86a2267219"
  },
  "kernelspec": {
   "display_name": "Python 3.9.7 64-bit ('base': conda)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.7"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
